package com.github.catvod.spider.merge;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import org.slf4j.impl.StaticLoggerBinder;

public final class bv {
  private static final String[] I;
  
  static final Gr V0 = new Gr();
  
  static volatile int h;
  
  static final l6 j = new l6();
  
  private static String oC;
  
  static boolean q = r.oC("slf4j.detectLoggerNameMismatch");
  
  static {
    I = new String[] { "1.6", "1.7" };
    oC = "org/slf4j/impl/StaticLoggerBinder.class";
  }
  
  private static void BQ() {
    synchronized (V0) {
      null.I();
      for (Aq aq : null.q())
        aq.I(Qy(aq.getName())); 
      return;
    } 
  }
  
  private static boolean F8() {
    String str = r.BQ("java.vendor.url");
    return (str == null) ? false : str.toLowerCase().contains("android");
  }
  
  private static void GM(Set<URL> paramSet) {
    if (oq(paramSet)) {
      r.j("Class path contains multiple SLF4J bindings.");
      for (URL uRL : paramSet) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("Found binding in [");
        stringBuilder.append(uRL);
        stringBuilder.append("]");
        r.j(stringBuilder.toString());
      } 
      r.j("See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.");
    } 
  }
  
  static void I(Throwable paramThrowable) {
    h = 2;
    r.q("Failed to instantiate SLF4J LoggerFactory", paramThrowable);
  }
  
  private static void PD(UW paramUW) {
    if (paramUW == null)
      return; 
    Aq aq = paramUW.h();
    String str = aq.getName();
    if (!aq.j()) {
      if (!aq.V0())
        if (aq.h()) {
          aq.q(paramUW);
        } else {
          r.j(str);
        }  
      return;
    } 
    throw new IllegalStateException("Delegate logger cannot be null at this state.");
  }
  
  private static final void PU() {
    try {
      String str = StaticLoggerBinder.REQUESTED_API_VERSION;
      String[] arrayOfString = I;
      int i = arrayOfString.length;
      byte b = 0;
      boolean bool = false;
      while (b < i) {
        if (str.startsWith(arrayOfString[b]))
          bool = true; 
        b++;
      } 
    } catch (NoSuchFieldError noSuchFieldError) {
    
    } finally {
      Exception exception = null;
    } 
  }
  
  public static vn Qy(String paramString) {
    return W().h(paramString);
  }
  
  private static void V0(UW paramUW, int paramInt) {
    if (paramUW.h().h()) {
      j(paramInt);
    } else if (!paramUW.h().V0()) {
      q();
    } 
  }
  
  public static Za W() {
    // Byte code:
    //   0: getstatic com/github/catvod/spider/merge/bv.h : I
    //   3: ifne -> 34
    //   6: ldc com/github/catvod/spider/merge/bv
    //   8: monitorenter
    //   9: getstatic com/github/catvod/spider/merge/bv.h : I
    //   12: ifne -> 22
    //   15: iconst_1
    //   16: putstatic com/github/catvod/spider/merge/bv.h : I
    //   19: invokestatic iU : ()V
    //   22: ldc com/github/catvod/spider/merge/bv
    //   24: monitorexit
    //   25: goto -> 34
    //   28: astore_1
    //   29: ldc com/github/catvod/spider/merge/bv
    //   31: monitorexit
    //   32: aload_1
    //   33: athrow
    //   34: getstatic com/github/catvod/spider/merge/bv.h : I
    //   37: istore_0
    //   38: iload_0
    //   39: iconst_1
    //   40: if_icmpeq -> 89
    //   43: iload_0
    //   44: iconst_2
    //   45: if_icmpeq -> 79
    //   48: iload_0
    //   49: iconst_3
    //   50: if_icmpeq -> 72
    //   53: iload_0
    //   54: iconst_4
    //   55: if_icmpne -> 62
    //   58: getstatic com/github/catvod/spider/merge/bv.j : Lcom/github/catvod/spider/merge/l6;
    //   61: areturn
    //   62: new java/lang/IllegalStateException
    //   65: dup
    //   66: ldc 'Unreachable code'
    //   68: invokespecial <init> : (Ljava/lang/String;)V
    //   71: athrow
    //   72: invokestatic getSingleton : ()Lorg/slf4j/impl/StaticLoggerBinder;
    //   75: invokevirtual getLoggerFactory : ()Lcom/github/catvod/spider/merge/Za;
    //   78: areturn
    //   79: new java/lang/IllegalStateException
    //   82: dup
    //   83: ldc 'org.slf4j.LoggerFactory in failed state. Original exception was thrown EARLIER. See also http://www.slf4j.org/codes.html#unsuccessfulInit'
    //   85: invokespecial <init> : (Ljava/lang/String;)V
    //   88: athrow
    //   89: getstatic com/github/catvod/spider/merge/bv.V0 : Lcom/github/catvod/spider/merge/Gr;
    //   92: areturn
    // Exception table:
    //   from	to	target	type
    //   9	22	28	finally
    //   22	25	28	finally
    //   29	32	28	finally
  }
  
  private static final void h() {
    Set<URL> set = null;
    try {
      if (!F8()) {
        set = oC();
        GM(set);
      } 
      StaticLoggerBinder.getSingleton();
      h = 3;
      j5(set);
      i4();
    } catch (NoClassDefFoundError noClassDefFoundError) {
      if (t(noClassDefFoundError.getMessage())) {
        h = 4;
        r.j("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".");
        r.j("Defaulting to no-operation (NOP) logger implementation");
        r.j("See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.");
      } else {
        I(noClassDefFoundError);
        throw noClassDefFoundError;
      } 
      i4();
    } catch (NoSuchMethodError noSuchMethodError) {
      String str = noSuchMethodError.getMessage();
      if (str != null && str.contains("org.slf4j.impl.StaticLoggerBinder.getSingleton()")) {
        h = 2;
        r.j("slf4j-api 1.6.x (or later) is incompatible with this binding.");
        r.j("Your binding is version 1.5.5 or earlier.");
        r.j("Upgrade your binding to version 1.6.x.");
      } 
      throw noSuchMethodError;
    } catch (Exception exception) {
      I(exception);
      IllegalStateException illegalStateException = new IllegalStateException();
      this("Unexpected initialization failure", exception);
      throw illegalStateException;
    } finally {}
  }
  
  private static void i4() {
    BQ();
    y();
    V0.V0();
  }
  
  private static final void iU() {
    h();
    if (h == 3)
      PU(); 
  }
  
  private static void j(int paramInt) {
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append("A number (");
    stringBuilder.append(paramInt);
    stringBuilder.append(") of logging calls during the initialization phase have been intercepted and are");
    r.j(stringBuilder.toString());
    r.j("now being replayed. These are subject to the filtering rules of the underlying logging system.");
    r.j("See also http://www.slf4j.org/codes.html#replay");
  }
  
  private static void j5(Set<URL> paramSet) {
    if (paramSet != null && oq(paramSet)) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append("Actual binding is of type [");
      stringBuilder.append(StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr());
      stringBuilder.append("]");
      r.j(stringBuilder.toString());
    } 
  }
  
  private static boolean n(Class<?> paramClass1, Class<?> paramClass2) {
    return paramClass2.isAssignableFrom(paramClass1) ^ true;
  }
  
  static Set<URL> oC() {
    LinkedHashSet<URL> linkedHashSet = new LinkedHashSet();
    try {
      Enumeration<URL> enumeration;
      ClassLoader classLoader = bv.class.getClassLoader();
      if (classLoader == null) {
        enumeration = ClassLoader.getSystemResources(oC);
      } else {
        enumeration = enumeration.getResources(oC);
      } 
      while (enumeration.hasMoreElements())
        linkedHashSet.add(enumeration.nextElement()); 
    } catch (IOException iOException) {
      r.q("Error getting resources from path", iOException);
    } 
    return linkedHashSet;
  }
  
  private static boolean oq(Set<URL> paramSet) {
    int i = paramSet.size();
    boolean bool = true;
    if (i <= 1)
      bool = false; 
    return bool;
  }
  
  private static void q() {
    r.j("The following set of substitute loggers may have been accessed");
    r.j("during the initialization phase. Logging calls during this");
    r.j("phase were not honored. However, subsequent logging calls to these");
    r.j("loggers will work as normally expected.");
    r.j("See also http://www.slf4j.org/codes.html#substituteLogger");
  }
  
  private static boolean t(String paramString) {
    return (paramString == null) ? false : (paramString.contains("org/slf4j/impl/StaticLoggerBinder") ? true : (paramString.contains("org.slf4j.impl.StaticLoggerBinder")));
  }
  
  public static vn u(Class<?> paramClass) {
    vn vn = Qy(paramClass.getName());
    if (q) {
      Class<?> clazz = r.h();
      if (clazz != null && n(paramClass, clazz)) {
        r.j(String.format("Detected logger name mismatch. Given name: \"%s\"; computed name: \"%s\".", new Object[] { vn.getName(), clazz.getName() }));
        r.j("See http://www.slf4j.org/codes.html#loggerNameMismatch for an explanation");
      } 
    } 
    return vn;
  }
  
  private static void y() {
    LinkedBlockingQueue<UW> linkedBlockingQueue = V0.j();
    int i = linkedBlockingQueue.size();
    ArrayList<? super UW> arrayList = new ArrayList(128);
    byte b = 0;
    while (true) {
      if (linkedBlockingQueue.drainTo(arrayList, 128) == 0)
        return; 
      for (UW uW : arrayList) {
        PD(uW);
        if (!b)
          V0(uW, i); 
        b++;
      } 
      arrayList.clear();
    } 
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/bv.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */